package com.cheng.example.geektime.designpatterns.j57.writeventbusauthor;



/**
 * 通知观察者
 */
public class RegNotificationObserver {

    private RegNotificationService regNotificationService = new RegNotificationService();

    @Subscribe
    // 订阅的意思
    public void handleRegSuccess(String userId) {
        regNotificationService.sendInboxMessage(Long.valueOf((String) userId), "Welcome...");
    }

    @Subscribe // 订阅的意思
    public void handleRegSuccess1(String userId) {
        regNotificationService.sendInboxMessage(Long.valueOf(userId), "Welcome...");
    }


    @Subscribe // 订阅的意思
    public void handleRegSuccess2(Parent userId) {
        regNotificationService.sendInboxMessage(1L, "Welcome...");
    }

    class Parent{

    }


    class  Son extends Parent {

    }

}
